<template>
	<view class="container">
		
		<button type="primary" @click="clickFunc1('cjm')">点击1</button>
		<button type="primary"  data-name='李白' id='34' @click="clickFunc2">点击2</button>
		<button type="primary" @click="clickFunc3">点击3</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name:'tom'
			}
		},
		methods: {
			clickFunc1(param){
				console.log(this);
				console.log(123);
				uni.showToast({
					title: param,
					icon:'fail'
				});
			},
			clickFunc2: function(e){
				console.log(e);
				console.log(e.currentTarget.dataset.name);
				// console.log(this);
				console.log(456);
				uni.showToast({
					title: '点击2',
					icon:'loading'
				});
			},
			clickFunc3:()=>{
				// console.log(this);
				console.log(789);
				uni.showToast({
					title: '点击3',
					icon:'error'
				});			
				}
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
